<?php
//功能描述:用戶登錄接口驗證
//方法説明:POST
//生成時間:2023-04-14 16:14:59
use \Sonkwl\UsePHP\jsoner;
if(!isset($_POST["s_no"])){
    jsoner::Response(array("res"=>"NG","message"=>"工號的沒有輸入"));
}
if(!preg_match("/^([A-Z]|[a-z]|\d)(\d{4,17}|(\d{4,17}[A-Z]\d{0,4}))|(^\d{18}$)|(^\d{17}(\d|X|x)$)$/",$_POST["s_no"])){
    jsoner::Response(array("res"=>"NG","message"=>"工號的格式錯誤"));
}
if(!isset($_POST["s_pwd"])){
    jsoner::Response(array("res"=>"NG","message"=>"密碼的沒有輸入"));
}
if(!preg_match("/^[0-9A-Za-z\-\_\*]{8,20}$/",$_POST["s_pwd"])){
    jsoner::Response(array("res"=>"NG","message"=>"密碼的格式錯誤"));
}
if(!isset($_POST["s_code"])){
    jsoner::Response(array("res"=>"NG","message"=>"驗證碼的沒有輸入"));
}
if(strlen($_POST["s_code"])<1 || strlen($_POST["s_code"])>4){
    jsoner::Response(array("res"=>"NG","message"=>"驗證碼的字數範圍1~4"));
}
if(count($_POST)!=3){
    jsoner::Response(array("res"=>"NG","message"=>"接口定義錯誤"));
}
?>
